/*
 *  $TEAM_NAME Space Trader
 */
package views;

import java.awt.Graphics;
import java.awt.Dimension;
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.IOException;
import javax.imageio.ImageIO;
import javax.swing.JPanel;

/**
 * Splash Panel
 * @author twb
 * @version 1.0
 */
public class SplashPanel extends JPanel {
	/**
	 * field
	 */
	private static final long serialVersionUID = 1L;

	/**
	 * field
	 */
	private BufferedImage image = null;

    /**
     * Constructor for SplashPanel.
     */
    public SplashPanel() {
       try {                
          image = ImageIO.read(new File("resources/splash_bkgd.png"));
       } catch (IOException ex) {
           // handle exception...
    	   System.err.println(ex);
       }
    }

    /**
     * Method paintComponent.
     * @param g Graphics
     */
    @Override
    public void paintComponent(Graphics g) {
        super.paintComponent(g);
        final Dimension size = getSize();
        g.drawImage(image, 0, 0, size.width, size.height, null); 
    }
}
